(function(b,r){"function"===typeof define&&define.amd?define([],function(){return r(b.Countly)}):"object"===typeof module&&module.exports?module.exports=r(b.Countly):b.Countly=r(b.Countly)})("undefined"!==typeof window?window:this,function(b){function r(a){if(!b.ignore_visitor)if(a.key){a.count||(a.count=1);var c=Q(a,["key","count","sum","dur","segmentation"]);c.timestamp=R();var f=new Date;c.hour=f.getHours();c.dow=f.getDay();q.push(c);j("cly_event",q);i("Adding event: ",a)}else i("Event must have key property")} function ga(){b.ignore_prefetch&&("undefined"!==typeof document.visibilityState&&"prerender"===document.visibilityState)&&(b.ignore_visitor=!0);b.ignore_bots&&Ea.test(navigator.userAgent)&&(b.ignore_visitor=!0)}function ha(a){var c=[];if("undefined"!==typeof a.options)for(var b=0;ba.trigger_font_color?"#"+a.trigger_font_color:a.trigger_font_color;d.style.backgroundColor=7>a.trigger_bg_color.length?"#"+a.trigger_bg_color:a.trigger_bg_color;d.className="countly-feedback-sticker "+ a.trigger_position;d.id="countly-feedback-sticker-"+a._id;d.innerHTML=' '+ a.trigger_button_text;document.body.appendChild(d);var h=document.getElementById("smileyPathInStickerSvg");h&&(h.style.fill=7>a.trigger_font_color?"#"+a.trigger_font_color:a.trigger_font_color);l(document.getElementById("countly-feedback-sticker-"+a._id),"click",function(){document.getElementById("countly-iframe-wrapper-"+a._id).style.display="block";document.getElementById("cfbg").style.display="block"})}else document.getElementById("countly-iframe-wrapper-"+a._id).style.display="block",document.getElementById("cfbg").style.display= "block"}catch(k){i("Somethings went wrong while element injecting process: "+k)}}function S(){if(C){var a={name:C,segment:Fa};b.check_consent("views")&&r({key:"[CLY]_view",dur:n()-G,segmentation:a});C=null}}function p(a){if(!b.ignore_visitor)if(!b.app_key||!b.device_id)i("app_key or device_id is missing");else{a.app_key=b.app_key;a.device_id=b.device_id;a.sdk_name=Ga;a.sdk_version=ka;a.ctl="count_client";b.check_consent("location")?(b.country_code&&(a.country_code=b.country_code),b.city&&(a.city=b.city),null!==b.ip_address&& (a.ip_address=b.ip_address)):a.location="";a.timestamp=R();var c=new Date;a.hour=c.getHours();a.dow=c.getDay();u.length>T&&u.shift();u.push(a);j("cly_queue",u,!0)}}function H(){if(b.ignore_visitor)U=!1;else{U=!0;ia();var a=0;if("undefined"!==typeof b.q&&0W&&(b.session_duration(a-x),x=a));0la)&&(X=!1,a=u.shift(),ma(w)&&(y&&(clearTimeout(y),y=null),a.consent=JSON.stringify(w),w={}),i("Processing request",a),J(b.url+Ha,a,function(a,c){i("Request Finished",c,a);a&&(u.unshift(c),la=n()+Y);j("cly_queue",u,!0); X=!0}));setTimeout(H,Z)}}function na(){return j("cly_id")||oa()}function oa(){var a=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var b=(a+16*Math.random())%16|0;a=Math.floor(a/16);return("x"===c?b:b&3|8).toString(16)})}function $(){var a={};a._app_version=b.app_version;a._ua=navigator.userAgent;if(screen.width){var c=screen.width?parseInt(screen.width):0,f=screen.height?parseInt(screen.height):0;if(0!==c&&0!==f){if(navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&& window.devicePixelRatio)c=Math.round(c*window.devicePixelRatio),f=Math.round(f*window.devicePixelRatio);else if(90===Math.abs(window.orientation))var e=c,c=f,f=e;a._resolution=""+c+"x"+f}}window.devicePixelRatio&&(a._density=window.devicePixelRatio);c=navigator.language||navigator.browserLanguage||navigator.systemLanguage||navigator.userLanguage;"undefined"!==typeof c&&(a._locale=c);if("undefined"!==typeof document.referrer&&document.referrer.length&&(c=pa.exec(document.referrer))&&c[11]&&c[11]!== window.location.hostname){c=!1;if(z&&z.length)for(f=0;f=a?K++:K=a;return K}function L(a,c,f){if(b.check_consent("crashes")&&a){var f=f||qa,e="";"object"===typeof a?"undefined"!==typeof a.stack?e=a.stack:("undefined"!==typeof a.name&&(e+=a.name+":"),"undefined"!==typeof a.message&&(e+=a.message+"\n"),"undefined"!==typeof a.fileName&&(e+="in "+a.fileName+"\n"),"undefined"!==typeof a.lineNumber&&(e+="on "+a.lineNumber),"undefined"!==typeof a.columnNumber&&(e+=":"+a.columnNumber)):e=a+"";c=c?!0:!1;a=$();e={_resolution:a._resolution, _error:e,_app_version:a._app_version,_run:n()-ra,_not_os_specific:!0};if(a=navigator.battery||navigator.webkitBattery||navigator.mozBattery||navigator.msBattery)e._bat=Math.floor(100*a.level);"undefined"!==typeof navigator.onLine&&(e._online=navigator.onLine?!0:!1);e._background=document.hasFocus()?!1:!0;0this.status?"function"===typeof f&&f(!1,c,this.responseText):4===this.readyState&&(i("Failed Server XML HTTP request",this.status),"function"===typeof f&&f(!0,c))};"GET"===d?e.send():e.send(g)}catch(h){i("Failed XML HTTP request",h),"function"===typeof f&&f(!0,c)}}function sa(a){var c=[],b;for(b in a)c.push(b+"="+encodeURIComponent(a[b]));return c.join("&")}function ta(a){return"/"===a.substr(a.length-1)?a.substr(0,a.length- 1):a}function Q(a,b){for(var f={},e,g=0;gea&&E.shift(),E.push(a))};b.stop_time=function(){F&&(F=!1,Ca=n()-x,da=n()-G)};b.start_time=function(){F||(F=!0,x=n()-Ca,G=n()-da,da=0)};b.track_sessions=function(){function a(){document[f]?b.stop_time():b.start_time()}function c(){N>=M&&b.start_time();N=0}b.begin_session();b.start_time();l(window,"beforeunload",function(){b.end_session()});l(window,"unload",function(){b.end_session()});var f="hidden"; f in document?document.addEventListener("visibilitychange",a):(f="mozHidden")in document?document.addEventListener("mozvisibilitychange",a):(f="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",a):(f="msHidden")in document?document.addEventListener("msvisibilitychange",a):"onfocusin"in document?(l(window,"focusin",function(){b.start_time()}),l(window,"focusout",function(){b.stop_time()})):(l(window,"focus",function(){b.start_time()}),l(window,"blur",function(){b.stop_time()}), l(window,"pageshow",function(){b.start_time()}),l(window,"pagehide",function(){b.stop_time()}));l(window,"mousemove",c);l(window,"click",c);l(window,"keydown",c);l(window,"scroll",c);setInterval(function(){N++;N>=M&&b.stop_time()},6E4)};b.track_pageview=function(a,c){S();a&&a.constructor===Array&&(c=a,a=null);a=a||window.location.pathname;if(c&&c.length)for(var f=0;f',J(b.url+"/o/feedback/multiple-widgets-by-id",{widgets:JSON.stringify(a)}, function(a,b,e){a&&i("Errors occurred:",a);try{for(var g=JSON.parse(e),a=0;a